<script setup>

import { computed } from 'vue';
import { useRoute } from 'vue-router';
import Sidebar from './components/Sidebar.vue';
//获得当前路由信息
const route = useRoute();
//判断当前路由是否是登录页面
const isLoginPage = computed(() =>{
  return route.path === '/';
})
</script>

<template>

   <el-container style="height: 100vh;">
    <!-- 左侧侧边栏 -->
    <el-aside v-if="!isLoginPage" width="200px">
      <Sidebar />
    </el-aside>

    <el-container>
        <el-header style="background-color: #f5f7fa; padding: 0;"></el-header>
        <el-main style="padding: 20px;">
          <router-view />
        </el-main>
      </el-container>
   </el-container>
</template>

<style scoped>

</style>
